package com.heima.dao;

import com.heima.domain.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IProductDao {
    @Select("select * from product")
    List<Product>  findAll();
    @Insert("insert into product(productNum,productName,departureTime,cityName,productPrice, productStatus,productDesc) " +
            " values(#{productNum},#{productName},#{departureTime},#{cityName},#{productPrice},#{productStatus},#{productDesc})")
    void save(Product product);
  @Select("select * from product where id=#{id}")
   Product findOneById(String id);
 @Delete("delete from product where id=#{id}")
    void deleteById(String id);
}
